package com.szh.zx.duoxiancheng.chapter1;

public class TestDaemon {
	public static void main(String[] args) {
		GOd gOd = new GOd();
		You you = new You();
		Thread thread = new Thread(gOd);
		thread.setDaemon(true);
		thread.start();
		new Thread(you).start();

	}
}

class You implements Runnable {

	@Override
	public void run() {
		for (int i = 0; i < 35; i++) {
			System.out.println("开心的");
		}
	}
}
class GOd implements Runnable{
	@Override
	public void run() {
		while (true){
			System.out.println("上帝");
		}
	}
}

